home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / BlueLibrary Pack1 v1.1 / BlueLibrary Pack1 ƒ / BD Common ƒ / CScrollingTextPane.h < prev    next >
Text File  |  1996-06-14  |  2KB  |  80 lines

  1. // ===========================================================================
  2. //    CScrollingTextPane.h
  3. //    Written by Christophe Causer
  4. //    ©1996 BlueDays Software.  All Rights Reserved.
  5. //
  6. //    You may use this class in any non-commercial program without
  7. //    permission.  The only restriction is that you must credit the
  8. //    author in your about box.  For commercial use, please contact
  9. //    the author at the email address below.
  10. //                    
  11. //    Send bug-reports and comments to bluedays@kagi.com
  12. //
  13. // ===========================================================================
  14.  
  15. #pragma once
  16.  
  17. #include <LPane.h>
  18. #include <LPeriodical.h>
  19.  
  20. #include <UGWorld.h>
  21.  
  22. class    CScrollingTextPane :    public LPane,
  23.                                 public LPeriodical {
  24.     public:
  25.         enum {class_ID = 'SrlT'};
  26.  
  27.         static CScrollingTextPane*    CreateFromStream(LStream *inStream);
  28.  
  29.                             // Life & Death
  30.                         CScrollingTextPane();
  31.                         CScrollingTextPane(
  32.                             const SPaneInfo&            inPaneInfo,
  33.                             ResIDT                        inTextResID,
  34.                             ResIDT                        inTxtrResID,
  35.                             Boolean                        inPreserveBackground = false,
  36.                             Boolean                        inInverted = false,
  37.                             Int16                        inAnimationTicks = 2);
  38.                         CScrollingTextPane( LStream *inStream);
  39.         virtual            ~CScrollingTextPane();
  40.  
  41.                             // Animation
  42.         virtual    void    SpendTime(const EventRecord &inMacEvent);
  43.  
  44.     protected:
  45.         virtual void    FinishCreateSelf();
  46.         virtual void    DrawSelf();
  47.  
  48.         typedef enum AnimateState  {
  49.             animate_Waiting,
  50.             animate_Active,
  51.             animate_Done
  52.         } AnimateState;
  53.  
  54.         LGWorld            *mCreditGWorld;
  55.         LGWorld            *mDrawGWorld;
  56.         LGWorld            *mBackGWorld;
  57.  
  58.         Int16            mTextResID;
  59.         Int16            mTxtrResID;
  60.         Boolean            mPreserveBackground;
  61.         Boolean            mInverted;
  62.         Int16            mAnimationTicks;
  63.         Int32            mNextAnimationTicks;
  64.         TEHandle        mTE;
  65.         Int16            mTextHeight;
  66.         Int32            mCurrentGreyLevel;
  67.         Int32            mGreyFadeChange;
  68.         Rect            mDisplayRect;
  69.  
  70.         AnimateState    mAnimCreditsFade;
  71.         AnimateState    mAnimCreditsScroll;
  72.  
  73.  
  74.                 // Manage the credits
  75.                 void    FetchCreditInfo(
  76.                             Int16                        inWidth);
  77.                 void    DrawCredits(
  78.                             Rect                        &inCreditRect);
  79.                 void    DrawToScreen();
  80. };